<script setup>
	import {
		ref
	} from 'vue'

	const open = ref(false)
</script>

<template>
	<button @click="open = true">Open Modal</button>

	<Teleport to="body">
		<div v-if="open" class="modal">
			<p>Hello from the modal!</p>
			<button @click="open = false">Close</button>
		</div>
	</Teleport>
</template>

<style scoped>
	.modal {
		width: 300px;
		height: 200px;
	}
</style>